package com.example.hw3.entity;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Table(name = "student")
public class Student {
    //属性
    //学号
    @Size(min=10,max=10,message="id must be at 11 characters long")
    @Id
    @Column(name="id")
    private String id;

    //姓名
    @NotBlank(message = "name is required")
    @Column(name="name")
    private String name;
    //专业
    @NotBlank(message = "profession is required")
    @Column(name="profession")
    private String profession;
    //年级
    @NotBlank(message = "grade is required")
    @Column(name="grade")
    private String grade;
    //学院
    @NotBlank(message = "college is required")
    @Column(name="college")
    private String college;
    //private List<classtochoose> classlist;



}
